/* 
 * File:   ParsingParams.cpp
 * Author: Paul Stupka
 *
 * Created on October 28, 2011, 1:31 AM
 */

#include "ParsingParams.h"

Parameters::Parameters(int argc, char* argv[])
{
    recursive = false;
    unhide = false;
    filepath = "";
    pattern = "";
    poptOption options[7] = {
        {"unhide", 'u', POPT_ARG_NONE | POPT_ARGFLAG_ONEDASH, &unhide, 0, "Include this option if you want to unhide file(s)", NULL},
        {"recursive", 'r', POPT_ARG_NONE | POPT_ARGFLAG_ONEDASH, &recursive, 0, "If set all subdirectories will be looked recursively", NULL},
        {"path", 'p', POPT_ARG_STRING | POPT_ARGFLAG_ONEDASH, &filepath, 0, "Specify a file or directory to hide", "STRING"},
        {"mask", 'm', POPT_ARG_STRING | POPT_ARGFLAG_ONEDASH, &pattern, 0, "Specify a mask for matching", "STRING"},
        {NULL, '\0', POPT_ARG_INCLUDE_TABLE, poptAliasOptions, 0, "Options imlemented via popt alias/exec:", NULL},
        {NULL, '\0', POPT_ARG_INCLUDE_TABLE, poptHelpOptions, 0, "Help options:", NULL},
        {NULL, '\0', 0, 0, 0, NULL, NULL}
    };        
    poptContext context = poptGetContext("name", argc, (const char**)argv, options, POPT_CONTEXT_NO_EXEC | POPT_CONTEXT_POSIXMEHARDER); 
    poptGetNextOpt(context);
    //patterns = (char**)poptGetArgs(context);
    poptFreeContext(context);    
}